package cn.zysheep.factory.before;

/**
 * @ClassName: CoffeeStore
 * @Description: 咖啡店
 * @Author: lyw
 * @Date: 2022/10/17 22:46
 */
public class CoffeeStore {

    public Coffee orderCoffee(String type) {
        Coffee coffee = null;
        if ("american".equals(type)) {
            coffee = new AmericanCoffee();
        } else if ("latte".equals(type)) {
            coffee = new LatteCoffee();
        } else {
            throw new RuntimeException("对不起，你所点的咖啡没有");
        }
        coffee.addsugar();
        coffee.addMilk();
        return coffee;
    }
}
